<template>
  <div>
    <p v-fontSize="fontSize">DirectiveComponent组件</p>
    <button @click="fontSize = '24px'">更改字体大小</button>
  </div>
</template>

<script setup>
import { ref } from "vue";

const fontSize = ref("14px");
const vFontSize = {
  mounted: (el, binding) => {
    el.style.fontSize = binding.value;
  },
  updated(el, binding) {
        el.style.fontSize = binding.value
    }
};
</script>

<style lang="scss" scoped></style>
